package com.codi.jobservice.job;

import com.codi.base.exception.BaseAppException;
import com.codi.base.spring.SpringContextHolder;
import com.codi.bus.core.job.FundBasicJobService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

/**
 * Created by asus on 2018/1/8.
 */
@Slf4j
@DisallowConcurrentExecution

public class FundOptionalJob extends QuartzJobBean {
    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("fund optional update job");

        FundBasicJobService fundBasicJobService = SpringContextHolder.getBean(FundBasicJobService.class);
        try {
            fundBasicJobService.updateFundValue();
        } catch (BaseAppException e) {
            e.printStackTrace();
        }
    }
}
